<script setup>
import { ref } from 'vue'
import axios from 'axios'

const username = ref('')
const password = ref('')

const login = async () => {
  try {
    const response = await axios.post('/base/login/pwd', {
      username: username.value,
      password: password.value
    }, {
      headers: {
        'Content-Type': 'application/json'
      }
    })
    console.log('Login success:', response.data)
  } catch (error) {
    console.error('Login failed:', error.response?.data || error.message)
  }
}
</script>